﻿@model B4Deal.Models.MultiModel
<div class="User-middle-box-profile">
    <div class="User-box-profile">
        <i class="title_order" style="color: Blue">Đăng ký doanh nghiệp</i>
    </div>
    <div class="User-box-profile" style="padding-top: 0">
        <p id="errormodify" class="validation-summary-errors" style="margin-top: 20px;">
        </p>
        <form action="javascript:void()" id="businessForm-id" class="middle-box-content personal">
        <p>
            Tên doanh nghiệp<span class="red">*</span></p>
        <div class="div_txtDK big-txt">
            <input name="busName" type="text" id="busName" style="width: 400px;"
                value= "@Model.business.TenDoanhNghiep" />
        </div>
        <p>
            Chức vụ<span class="red">*</span></p>
        <div class="div_txtDK big-txt">
            <input name="busLevel" type="text" id="busLevel" style="width: 400px;" value="@Model.business.ChucVu" />
        </div>
        <p>
            Website<span class="red">*</span></p>
        <div class="div_txtDK big-txt">
            <input name="busWeb" type="text" id="busWeb" style="width: 400px;" value="@Model.business.Website" />
        </div>
        <p>
            Địa chỉ<span class="red">*</span></p>
        <div class="div_txtDK big-txt">
            <input name="busAddr" type="text" id="busAddr" style="width: 400px;" value="@Model.business.DiaChi" />
        </div>
        <p>
            Loại hình KD <span class="red">*</span></p>
        <div class="div_txtDK big-txt">
            <select name="typeBusInfo" id="typeBusInfo" class="big-txt" style="width: 350px;">
                <option value="Ăn uống">Ăn uống</option>
                <option value="Du Lịch">Du Lịch</option>
                <option value="Giải trí">Giải trí</option>
                <option value="Thời trang">Thời trang</option>
                <option value="Làm đẹp">Làm đẹp</option>
                <option value="Công nghệ">Công nghệ</option>
                <option value="Công nghiệp">Công nghiệp</option>
                <option value="Gia dụng">Gia dụng</option>
                <option value="Đào tạo">Đào tạo</option>
                <option value="Khác">Khác</option>
            </select>
        </div>
        <script type="text/javascript">
            $("#typeBusInfo option[value='@Model.business.LoaiHinhKinhDoanh']").attr("selected", true);
        </script>
        <p>
            Thông tin hợp tác</p>
        <div class="div_txtDK big-txt" style="background: none">
            <textarea name="txtConcept" id="txtConcept" type="text" style="max-width: 600px;
                max-height: 100px; margin-left: 0px; margin-right: 0px; width: 450px; margin-top: 3px;
                margin-bottom: 3px; height: 50px;" rows="3" value = "@Model.business.ThongTinHopTac"></textarea>
        </div>
        <p class="middle-box-checkbox">
            <span>
                <input name="agreeBusRule" type="checkbox" id="agreeBusRule">
            </span><span class="middle-box-text">Đồng ý điều luật kinh doanh</span>
        </p>
        <!--<em class="btn-line"></em>-->
        <p class="middle-box-button">
            <a href="javascript:void()" id="btnCreateDeal" class="user_add_button" style="background: url('../../Content/Layout/Images/btn-gui.png') no-repeat 0 0;
                display: block; height: 52px; width: 160px; float: left; position: relative;"
                onclick="CreateDealView()">Deal</a> <a href="javascript:void()" id="btnSaveBus" class="save_button_vn">
                </a><a href="javascript:void()" id="btnReset" class="cancel_button_vn" onclick="document.getElementById('businessForm-id').reset();">
                </a>
        </p>
        <p class="middle-box-require">
            <span class="red">*</span><span class="lost-pass">thông tin bắt buộc</span></p>
        </form>
    </div>
</div>
<script type="text/javascript">
    $('#btnSaveBus').click(function () {
        $("#errormodify").html("");
        $.ajax({
            url: '@Url.Action("ModifyBusiness")',
            type: "POST",
            data: $("#businessForm-id").serialize(),
            success: function (result) {
                var success = result.rs;
                if (success == "success") {
                    $("#errormodify").html("<span>" + result.detail + "</span>");
                    setDefault();
                }
                else if (success == "fail") {
                    $("#errormodify").html("<span>" + result.detail + "</span>");
                }
                else {
                    $("#errormodify").html("<span>Lưu thông tin thay đổi thành công!</span>");
                }
            }
        });
    });
</script>
